<?php
class m_comment extends Zmodel{

	function get_classify_comment_pro($product_id){
	  $sql="SELECT com_id,
				  product_id,
				  user_id,
				  user_login,
				  com_desc,
				  post_date,
				  status
			FROM classify_comments
			WHERE product_id=".$product_id;
	  $query = $this->db->query($sql);
	  return $query->result_array();
	}
	
	function insert_class_comments($product_id,
						  $user_id,
						  $user_login,
						  $com_desc){
		$sql="SET TIMEZONE TO 'Asia/Phnom_Penh';
			  INSERT INTO classify_comments(product_id,
						  user_id,
						  user_login,
						  com_desc,
						  post_date)
			  VALUES(".$product_id.",
			  		 ".$user_id.",
			  		 '".pg_escape_string($user_login)."',
			  		 '".pg_escape_string($com_desc)."',
			  		 CURRENT_TIMESTAMP)";
			  return $this->db->query($sql);
	}
}
?>